class Character < ActiveRecord::Base
  has_one :status
  belongs_to :member
  has_many :mission_registrations
  
  validates_uniqueness_of :name
  
  
  def self.for_member(member)
    character = self.new
    character.name = "DefaultName"
    if not member.characters.empty?
      character.name = character.name + ( member.characters.last.id + 1 ).to_s
    end
    character.member = member
    return character
  end
end
